#include<stdio.h>

int main()
{
    int n = 0;
    scanf("%d", &n);
    int arr[5] = { 0 };
    int i = 3;
    while (n)
    {
        int j = ((n % 10) + 9) % 10;
        arr[i] = j;
        i--;
        n /= 10;
    }
    int tmp1 = arr[0];
    arr[0] = arr[2];
    arr[2] = tmp1;
    int tmp = arr[1];
    arr[1] = arr[3];
    arr[3] = tmp;
    printf("The encrypted number is ");
    for (int i = 0; i < 4; i++)
    {
        printf("%d", arr[i]);
    }
    return 0;
}